import IndexAsync from "@layout/indexAsync.vue";
import type {VRouteRecordRaw} from "@router/type/VRouterMeta.ts";

export const staticRouter: VRouteRecordRaw[] = [
    {
        path: '/',
        component: IndexAsync,
        redirect: '/index',
        meta: {title: '首页'},
        children: [
            {
                path: '/index',
                component: () => import('@view/common/Index.vue'),
                meta: {
                    title: '首页',//页面标题
                    isTab: 1,//是否为TabView视图
                    tabFixed: 1,//是否固定不可清除
                }
            },
            {
                path: '/layout/401',
                component: () => import('@view/common/401.vue'),
                meta: {
                    title: '访问权限不足',
                }
            },
            {
                path: '/layout/404',
                component: () => import('@view/common/404.vue'),
                meta: {
                    title: '访问权限不足',
                }
            },
            {
                path: '/:pathMatch(.*)*',
                redirect: '/layout/404'
            }
        ]
    },
    {
        path: '/401',
        component: () => import('@view/common/401.vue'),
        meta: {
            title: '访问权限不足'
        }
    },
    {
        path: '/404',
        component: () => import('@view/common/404.vue'),
        meta: {
            title: '访问权限不足'
        }
    },
    {
        path: '/:pathMatch(.*)*',
        redirect: '/404'
    }
]

export const initRouter: any[] = [...staticRouter]